package com.example.zhuyu.basemvp.http;

import com.example.zhuyu.basemvp.utils.LogUtil;

import okhttp3.logging.HttpLoggingInterceptor;

public class LogInterceptor {

    public LogInterceptor() {
    }

    //日志拦截器
    public HttpLoggingInterceptor logInterceptor() {
        return new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
            @Override
            public void log(String message) {
                LogUtil.e(message);
            }
        })
                //设置打印数据的级别
                .setLevel(HttpLoggingInterceptor.Level.BASIC);
    }
}
